public class Person {
    public String name = "叶叶";
    public String gender = "女";//性别
    public int age = 17;

    public static String friend;

static {
    friend = "飞飞";
    System.out.println("静态代码块被执行了.......");
}

public static void makefriend(){
    System.out.println("我和"+friend+"是好朋友");
}
    public Person(){

        System.out.println("我叫"+name+"我的年龄是"+age+"我的性别是"+gender);
        System.out.println("不带参数的构造方法被执行了......");
    }

    //`实例代码块
    {
        this.name = "叶瑾";
        this.gender = "男生";
        this.age = 18;
        System.out.println("实例代码块被执行了......");
    }

    public Person(String name,int age){
        this.name = name;
        this.age = age;
        System.out.println(name);
        System.out.println(age);
        System.out.println("带两个参数的构造方法被执行了......");

    }
}
